// 背包道具显示类

var UIBagItem = cc.Node.extend({

	image : null,
    id : 0, 
    cx : 0,
    cy : 0,

    _data : null,


    ctor : function (data) {
        this._super();

        this._data = data;

    	var file = 'res/icon/'+'shell_1_s.png';
        this.image = cc.Sprite.create(file);
    	this.addChild(this.image);
	},

    // 设置格子坐标
    setBagPos : function (cx, cy) {
        this.cx = cx;
        this.cy = cy;
        this.setPosition( helper.posCell2Bag(cx, cy) );
    },

    getBagPos : function () {
        return cc.p(this.cx, this.cy);
    },

    onClick : function () {
        cc.log('onClick:'+this.id);
        
    },

});

